import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysToolColumns = (params) => {
  params.head.transCode = 'querySysToolColumns';
  return request({
    url: '/tool/sysToolColumns/querySysToolColumns',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysToolColumnsListPage = (params) => {
  params.head.transCode = 'querySysToolColumnsListPage';
  return request({
    url: '/tool/sysToolColumns/querySysToolColumnsListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysToolColumns = (params) => {
  params.head.transCode = 'saveSysToolColumns';
  return request({
    url: '/tool/sysToolColumns/saveSysToolColumns',
    method: 'post',
    data: params
  })
}

//新增或修改单条记录
export const saveOrUpdateSysToolColumns = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolColumns';
  return request({
    url: '/tool/sysToolColumns/saveOrUpdateSysToolColumns',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysToolColumnsList = (params) => {
  params.head.transCode = 'saveOrUpdateSysToolColumnsList';
  return request({
    url: '/tool/sysToolColumns/saveOrUpdateSysToolColumnsList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysToolColumns = (params) => {
  params.head.transCode = 'updateSysToolColumns';
  return request({
    url: '/tool/sysToolColumns/updateSysToolColumns',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysToolColumns = (params) => {
  params.head.transCode = 'deleteSysToolColumns';
  return request({
    url: '/tool/sysToolColumns/deleteSysToolColumns',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysToolColumnsList = (params) => {
  params.head.transCode = 'deleteSysToolColumnsList';
  return request({
    url: '/tool/sysToolColumns/deleteSysToolColumnsList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysToolColumnsExcel = (params) => {
  downloadExcel({
    url: '/tool/sysToolColumns/excelDownload/exportSysToolColumnsExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
